package com.wasu.livedata;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;

import com.wasu.netutils.live.DataSourceLive;
import com.wasu.netutils.live.LiveCacheStrategy;


public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.button1).setOnClickListener(v -> {
            new Thread(() -> {
                Log.d("MainActivity", "queryChannelGroup_1");
                DataSourceLive.getInstance().queryChannelGroup(MainActivity.this,  LiveCacheStrategy.FIRST_NETWORK, "1");
                Log.d("MainActivity", "queryChannelGroup_2");
            }).start();
        });


        findViewById(R.id.button2).setOnClickListener(v -> {
            new Thread(() -> {
                Log.d("MainActivity", "queryProgramList_1");
                DataSourceLive.getInstance().queryProgramList(MainActivity.this, LiveCacheStrategy.FIRST_NETWORK, "2", "", "00000000000000000000000000005210");
                Log.d("MainActivity", "queryProgramList_2");
            }).start();
        });
    }
}